package com.app.mymusic.ui.login;

/**
 * Created by Administrator on 2016-12-5.
 */

public class LoginPresenter {
    private LoginActivity activity;
    private LoginModel loginModel;

    public LoginPresenter(LoginActivity activity) {
        this.activity = activity;
        loginModel=new LoginModel();
    }
    public void Login(String name ,String psw,String id){
        loginModel.login(name,psw,id, new LoginCallback() {
            @Override
            public void loginSuccess(String res) {
                activity.showSucess(res);
            }

            @Override
            public void loginError(String res) {
                activity.showError(res);
            }
        });
    }

    public interface LoginCallback{
        void loginSuccess(String res);
        void loginError(String res);
    }
}
